package com.fowo.api.common.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(value = { ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
@Constraint(validatedBy = EnumsStringValidator.class)
public @interface EnumsString {
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};

    /**
     * 枚举所有可能的值
     */
    String[] value();

    /**
     * 错误消息
     */
    String message() default "不是有效值";

    /**
     * 可多个值
     */
    boolean flags() default false;
}
